<?php

# mvblogs_2-0
# 2006 Oct 06  08:30:53
# returns the global mysqli connection object

function getDBConnection()
{
    if (isset($GLOBALS['CONFIG']['db']['conn']) &&
        get_class($GLOBALS['CONFIG']['db']['conn']) == 'mysqli') {
        return $GLOBALS['CONFIG']['db']['conn'];
    }

    # if the db connection object is not set or enabled throw exception
    throw new Exception('could not get db connection');
}